package org.wattdepot.simulation.basic;

/**
 * Mainly used by QuadSlave that combines multiple values in one instance.
 * @author Alan Lee
 *
 */
public class BitTimeManipulation {
  
  /**
   * An instance to enable methods storing multiple values.
   */
  public BitTimeManipulation() {
    //empty constructor.
  }
  
  /**
   * Convert date/time to strings so it will be combined then converted
   * as 16-bit integer value. 
   * @param firstVal Internal date/time of system.
   * @param secondVal Internal date/time of system.  
   * @return multipleValue two values as one 16-bit decimal value representation.
   */
  public int combineMultipleValue(int firstVal, int secondVal) {
    String hex1 = Integer.toHexString(firstVal);
    String hex2 = Integer.toHexString(secondVal);
    String combination = hex1 + hex2;
    return Integer.parseInt(combination, 16);
  }
  
}
